package kitty.main.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class SqlHelper extends SQLiteOpenHelper {

	public static final String HIGHSCORE_TABLE_NAME="highscore";
	public static final String HIGHSCORE_NAME_COLUMN_NAME="name";
	public static final String HIGHSCORE_SCORE_COLUMN_NAME="score";
	public static final String HIGHSCORE_DATETIME_COLUMN_NAME="datetime";
	
	public static final String DATABASE_NAME = "kittyvzombie";
	public static final int DATABASE_VERSION = 2;

	private static final String CREATE_HIGHSCORE_TABLE= "CREATE TABLE " + HIGHSCORE_TABLE_NAME +
			" ("+HIGHSCORE_NAME_COLUMN_NAME+" text, " + HIGHSCORE_SCORE_COLUMN_NAME + " integer, " + 
			HIGHSCORE_DATETIME_COLUMN_NAME+ " integer " +");";

	public SqlHelper(Context context, String name, CursorFactory factory,
			int version) {
		super(context, name, factory, version);
		// TODO Auto-generated constructor stub
	}

	public SqlHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(CREATE_HIGHSCORE_TABLE);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		
	}

}
